package lyx.totalexample.imagesearch.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@RequestMapping("/page")
@Tag(name = "页面跳转")
public class HtmlJumpController {


    @GetMapping("/index")
    @Operation(summary = "初始化首页", description = "初始化首页")
    public String init(@RequestParam(name="name", required=false, defaultValue="World") String name, Model model) {
        model.addAttribute("name", name);
        return "index";
    }

    @GetMapping("/uploadImage")
    public String localThymeleafPage() {
        return "page/uploadImage"; // 返回 Thymeleaf 模板
    }
}
